package com.net.dao.sell;

import java.util.List;

import com.net.model.Commodity;
import com.net.model.Customer;
import com.net.model.SellBackDetail;
import com.net.model.SellBackMain;

public interface SellBackMainDao {
	
	public void save(SellBackMain sellBackMain);
	public void update(SellBackMain sellBackMain);
	public boolean delete(SellBackMain sellBackMain);
	public SellBackMain loadSellBackMainByName(String name);
	/**
	 * 查询列表
	 * @param currentPage当前页数
	 * @param perPage每页记录数
	 * @param orderType排序方式 dec或者asc
	 * @param orderName
	 * @return
	 */
	public List<SellBackMain> getSellBackMains(final int currentPage,final int perPage,final String orderType,final String orderName);
	/**
	 * 条件查询列表
	 * @param currentPage
	 * @param perPage
	 * @param condition查询条件
	 * @return
	 */
	public List<SellBackMain> getSellBackMainsByCondition(final int currentPage,final int perPage,final String condition);
	public SellBackMain loadSellBackMainById(int id);
	public int getCount();
	public List<SellBackMain> getSellBackMains();
	public Commodity getCommodityByName(String name);
	public Customer getCustomerByName(String customerName);
	public void add(SellBackDetail sb);
	public void save(SellBackMain sellBackMain, List<Commodity> commoditys,
			Customer customer, List<SellBackDetail> sellBackDetails);
	public SellBackMain getSellBackMainById(int id);
	public void update(SellBackMain sellBackMain, List<Commodity> commoditys,
			Customer customer, List<SellBackDetail> sellBackDetails);
}
